package com.hzhr.iot.core.util.generator;

import com.hzhr.iot.core.annotation.*;
import com.hzhr.iot.core.util.HzhrFileUtil;
import com.hzhr.iot.core.util.HzhrStringUtils;
import org.springframework.util.StringUtils;

import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.util.*;

public class ConvertorGenerator {
    public static String projectName;
    public static String rootPath;
    public static String rootPackageName;

    public static void run() throws Exception {
        String srcRootPath = rootPath;
        List<File> files = HzhrFileUtil.getFiles(srcRootPath + "\\entity");


        for (File file : files) {//遍历example
            String fileName = file.getName();
            if (fileName.endsWith("Entity.java")) {
                String resourceName = fileName.substring(0, fileName.lastIndexOf("Entity.java"));
                String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);

                Class entityClass = Class.forName(rootPackageName + ".entity." + resourceName + "Entity");
                Class extClass = null;
                try {
                    extClass = Class.forName(rootPackageName + ".entity.ext." + resourceName + "EntityExt");
                } catch (Exception e) {

                }
                Class customClass = null;
                try {
                    customClass = Class.forName(rootPackageName + ".entity.custom." + resourceName + "EntityCustom");
                } catch (Exception e) {

                }
                Class withBlobClass = null;
                try {
                    withBlobClass = Class.forName(rootPackageName + ".entity." + resourceName + "EntityWithBLOBs");
                } catch (Exception e) {

                }
                Class modelClass = null;
                try {
                    modelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "Model");
                } catch (Exception e) {

                }
                Class postModelClass = null;
                try {
                    postModelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PostModel");
                } catch (Exception e) {

                }
                Class putModelClass = null;
                try {
                    putModelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PutModel");
                } catch (Exception e) {

                }
                Class patchModelClass = null;
                try {
                    patchModelClass = Class.forName(rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PatchModel");
                } catch (Exception e) {

                }

                StringBuilder sb = new StringBuilder();
                StringBuilder importSb = new StringBuilder();
                importSb.append("package " + rootPackageName + ".convertor;\n\n");
                importSb.append("import " + rootPackageName + ".convertor.custom.*;\n");
                importSb.append("import com.hzhr.iot.core.util.HzhrTypeUtil;\n");
                importSb.append("import com.hzhr.iot.core.util.HzhrJsonUtil;\n");
                importSb.append("import java.util.Map;\n");
                if (modelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "Model;\n");
                }
                if (postModelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PostModel;\n");
                }
                if (putModelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PutModel;\n");
                }
                if (patchModelClass != null) {
                    importSb.append("import " + rootPackageName + ".model." + resourceNameFl + "." + resourceName + "PatchModel;\n");
                }
                importSb.append("import " + rootPackageName + ".entity." + resourceName + "Entity;\n");
                if (extClass != null) {
                    importSb.append("import " + rootPackageName + ".entity.ext." + resourceName + "EntityExt;\n");
                }
                if (withBlobClass != null) {
                    importSb.append("import " + withBlobClass.getName() + ";\n");
                }
                if (customClass != null) {
                    importSb.append("import " + customClass.getName() + ";\n");
                }
                //importSb.append("import " + rootPackageName + ".queryModel.custom." + resourceName + "CustomQueryModel;\n");
                importSb.append("import org.springframework.beans.factory.annotation.Autowired;\n");
                importSb.append("import org.springframework.stereotype.Component;\n");
                importSb.append("import java.util.ArrayList;\n");
                importSb.append("import java.util.Date;\n");
                importSb.append("import java.util.List;\n");

                StringBuilder autowireSb = new StringBuilder();
                for (File file1 : files) {//遍历example
                    String fileName1 = file1.getName();
                    if (fileName1.endsWith("Entity.java")) {
                        String resourceName1 = fileName1.substring(0, fileName1.lastIndexOf("Entity.java"));
                        if (resourceName.equals(resourceName1)) continue;
                        String resourceNameFl1 = HzhrStringUtils.firstCharToLowerCase(resourceName1);
                        autowireSb.append("    @Autowired\n");
                        autowireSb.append("    " + resourceName1 + "CustomConvertor " + resourceNameFl1 + "CustomConvertor;\n");
                    }
                }
                StringBuilder functionSb = new StringBuilder();


                List<File> modelFiles = HzhrFileUtil.getFiles(srcRootPath + "\\model");
                for (File modelFile :
                modelFiles) {
                    String modelFileName = modelFile.getName();
                    if (!modelFileName.endsWith("Model.java")) continue;
                    String modelName = modelFileName.substring(0, modelFileName.lastIndexOf("Model.java"));
                    String modelNameFl = HzhrStringUtils.firstCharToLowerCase(modelName);
                    String modelPath = modelFile.getPath();
                    String[] split = modelPath.substring(0, modelPath.lastIndexOf(modelFileName)).split("\\\\");

                    String pre = "";
                    for (int i = split.length - 1; i >= 0; i--) {
                        String item = split[i];
                        if ("model".equals(item)) break;
                        pre = item + "." + pre;
                    }
                    Class<?> modelClass1 = Class.forName(rootPackageName + ".model." + pre + modelName + "Model");
                    CygModel cygModel = modelClass1.getAnnotation(CygModel.class);
                    if (cygModel != null) {
                        Class<?> entityClass1 = cygModel.entity();
                        if (entityClass1 != null && entityClass.getName().equals(entityClass1.getName())) {
                            importSb.append("import " + modelClass1.getName() + ";\n");

                            //model2entity
                            functionSb.append("    public " + resourceName + "Entity " + modelNameFl + "Model2entity(" + modelName + "Model in) {\n");
                            functionSb.append(generate(modelClass1, entityClass, resourceName, "HzhrTypeUtil"));
                            functionSb.append("    }\n");
                            functionSb.append("    public " + resourceName + "Entity " + modelNameFl + "Model2entity(" + modelName + "Model in, " + resourceName + "Entity ori) {\n");
                            functionSb.append(generate5(modelClass1, entityClass, resourceName, "HzhrTypeUtil"));
                            functionSb.append("    }\n");
                            functionSb.append("    public List<" + resourceName + "Entity> " + modelNameFl + "ModelList2entityList(List<" + modelName + "Model> in) {\n");
                            functionSb.append("        if (in == null) return null;\n");
                            functionSb.append("        List<" + resourceName + "Entity> result = new ArrayList<>();\n");
                            functionSb.append("        for (" + modelName + "Model item : in) {\n");
                            functionSb.append("            result.add(" + modelNameFl + "Model2entity(item));\n");
                            functionSb.append("        }\n");
                            functionSb.append("        return result;\n");
                            functionSb.append("    }\n");
                            if (withBlobClass != null) {
                                functionSb.append("    public " + resourceName + "EntityWithBLOBs " + modelNameFl + "Model2withBLOBs(" + modelName + "Model in) {\n");
                                functionSb.append(generate(modelClass1, withBlobClass, resourceName, "HzhrTypeUtil"));
                                functionSb.append("    }\n");
                                functionSb.append("    public List<" + resourceName + "EntityWithBLOBs> " + modelNameFl + "ModelList2withBLOBsList(List<" + modelName + "Model> in) {\n");
                                functionSb.append("        if (in == null) return null;\n");
                                functionSb.append("        List<" + resourceName + "EntityWithBLOBs> result = new ArrayList<>();\n");
                                functionSb.append("        for (" + modelName + "Model item : in) {\n");
                                functionSb.append("            result.add(" + modelNameFl + "Model2withBLOBs(item));\n");
                                functionSb.append("        }\n");
                                functionSb.append("        return result;\n");
                                functionSb.append("    }\n");
                            }

                            //entity2model
                            functionSb.append("    public " + modelName + "Model entity2" + modelNameFl + "Model(" + resourceName + "Entity in) {\n");
                            functionSb.append(generate(entityClass, modelClass1, resourceName, "HzhrTypeUtil"));
                            functionSb.append("    }\n");
                            functionSb.append("    public List<" + modelName + "Model> entityList2" + modelNameFl + "ModelList(List<" + resourceName + "Entity> in) {\n");
                            functionSb.append("        if (in == null) return null;\n");
                            functionSb.append("        List<" + modelName + "Model> result = new ArrayList<>();\n");
                            functionSb.append("        for (" + resourceName + "Entity item : in) {\n");
                            functionSb.append("            result.add(entity2" + modelNameFl + "Model(item));\n");
                            functionSb.append("        }\n");
                            functionSb.append("        return result;\n");
                            functionSb.append("    }\n");

                            functionSb.append("    public " + modelName + "Model ext2" + modelNameFl + "Model(" + resourceName + "EntityExt in) {\n");
                            functionSb.append(generate(extClass, modelClass1, resourceName, "HzhrTypeUtil"));
                            functionSb.append("    }\n");
                            functionSb.append("    public List<" + modelName + "Model> extList2" + modelNameFl + "ModelList(List<" + resourceName + "EntityExt> in) {\n");
                            functionSb.append("        if (in == null) return null;\n");
                            functionSb.append("        List<" + modelName + "Model> result = new ArrayList<>();\n");
                            functionSb.append("        for (" + resourceName + "EntityExt item : in) {\n");
                            functionSb.append("            result.add(ext2" + modelNameFl + "Model(item));\n");
                            functionSb.append("        }\n");
                            functionSb.append("        return result;\n");
                            functionSb.append("    }\n");

                            if (withBlobClass != null) {
                                functionSb.append("    public " + modelName + "Model withBLOBs2" + modelNameFl + "Model(" + resourceName + "EntityWithBLOBs in) {\n");
                                functionSb.append(generate(withBlobClass, modelClass1, resourceName, "HzhrTypeUtil"));
                                functionSb.append("    }\n");
                                functionSb.append("    public List<" + modelName + "Model> withBLOBsList2" + modelNameFl + "ModelList(List<" + resourceName + "EntityWithBLOBs> in) {\n");
                                functionSb.append("        if (in == null) return null;\n");
                                functionSb.append("        List<" + modelName + "Model> result = new ArrayList<>();\n");
                                functionSb.append("        for (" + resourceName + "EntityWithBLOBs item : in) {\n");
                                functionSb.append("            result.add(withBLOBs2" + modelNameFl + "Model(item));\n");
                                functionSb.append("        }\n");
                                functionSb.append("        return result;\n");
                                functionSb.append("    }\n");
                            }

                            if (customClass != null) {
                                functionSb.append("    public " + modelName + "Model custom2" + modelNameFl + "Model(" + resourceName + "EntityCustom in) {\n");
                                functionSb.append("        if (in == null) return null;\n");
                                functionSb.append("        " + modelClass1.getSimpleName() + " result = ext2" + modelNameFl + "Model(in);\n");
                                functionSb.append(generate4(customClass, modelClass1, resourceName, "HzhrTypeUtil"));
                                functionSb.append("    }\n");
                                functionSb.append("    public List<" + modelName + "Model> customList2" + modelNameFl + "ModelList(List<" + resourceName + "EntityCustom> in) {\n");
                                functionSb.append("        if (in == null) return null;\n");
                                functionSb.append("        List<" + modelName + "Model> result = new ArrayList<>();\n");
                                functionSb.append("        for (" + resourceName + "EntityCustom item : in) {\n");
                                functionSb.append("            result.add(custom2" + modelNameFl + "Model(item));\n");
                                functionSb.append("        }\n");
                                functionSb.append("        return result;\n");
                                functionSb.append("    }\n");
                            }

                            //entity2getModel
                            Class<?> getModelClass = null;
                            try {
                                String modelClass1Name = modelClass1.getName();
                                getModelClass = Class.forName(modelClass1Name.substring(0, modelClass1Name.lastIndexOf("Model")) + "GetModel");
                            } catch (Exception e) {

                            }
                            if (getModelClass != null) {
                                String getModelSimpleName = getModelClass.getSimpleName();
                                importSb.append("import " + getModelClass.getName() + ";\n");

                                boolean hasModelList = true;
                                try {
                                    getModelClass.getDeclaredField("modelList");
                                } catch (NoSuchFieldException e) {
                                    hasModelList = false;
                                }

                                boolean hasModel = true;
                                try {
                                    getModelClass.getDeclaredField("model");
                                } catch (NoSuchFieldException e) {
                                    hasModel = false;
                                }

                                boolean hasTotal = true;
                                try {
                                    getModelClass.getDeclaredField("total");
                                } catch (NoSuchFieldException e) {
                                    hasTotal = false;
                                }

                                boolean hasChangeCount = true;
                                try {
                                    getModelClass.getDeclaredField("changeCount");
                                } catch (NoSuchFieldException e) {
                                    hasChangeCount = false;
                                }

                                if (customClass != null) {
                                    functionSb.append("    public " + getModelSimpleName + " customList2" + modelNameFl + "GetModel(List<" + resourceName + "EntityCustom> customList, Integer total, Integer changeCount, Map<String, Object> query) {\n");
                                    functionSb.append("        List<" + modelName + "Model> modelList = customList2" + modelNameFl + "ModelList(customList);\n");
                                    functionSb.append("        if (modelList == null) {\n");
                                    functionSb.append("            " + modelName + "GetModel result = new " + modelName + "GetModel();\n");
                                    if (hasTotal) {
                                        functionSb.append("            result.setTotal(total);\n");
                                    }
                                    if (hasChangeCount) {
                                        functionSb.append("            result.setChangeCount(changeCount);\n");
                                    }
                                    functionSb.append("            return result;\n");
                                    functionSb.append("        }\n");
                                    functionSb.append("\n");

                                    functionSb.append("         String _show = query.get(\"_show\") != null ? query.get(\"_show\").toString() : \"one\";\n");
                                    Map<String, List<String>> showMap = new HashMap<>();
                                    for (Field field:
                                            modelClass1.getDeclaredFields()) {
                                        String fieldName = field.getName();
                                        if (field.getType().getSimpleName().equals("Boolean") && fieldName.startsWith("is")) {
                                            fieldName = fieldName.substring(2);
                                        }
                                        CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                                        if (cygProperty != null) {
                                            String show = cygProperty.show();

                                            if (!StringUtils.isEmpty(show)) {
                                                if (showMap.get(show) != null) {
                                                    List<String> list = showMap.get(show);
                                                    if (!StringUtils.isEmpty(fieldName)) {
                                                        list.add(fieldName);
                                                    }
                                                } else {
                                                    List<String> list = new ArrayList<>();
                                                    showMap.put(show, list);
                                                    if (!StringUtils.isEmpty(fieldName)) {
                                                        list.add(fieldName);
                                                    }
                                                }
                                            }
                                        }
                                    }

                                    for (Map.Entry<String, List<String>> entry :
                                            showMap.entrySet()) {
                                        String key = entry.getKey();
                                        functionSb.append("         Boolean " + key + " = query.get(\"" + key + "\") != null ? Boolean.parseBoolean(query.get(\"" + key + "\").toString()) : false;\n");
                                    }

                                    functionSb.append("\n");

                                    for (Map.Entry<String, List<String>> entry :
                                            showMap.entrySet()) {
                                        String key = entry.getKey();
                                        List<String> value = entry.getValue();
                                        functionSb.append("        if (!" + key + ") {\n");
                                        functionSb.append("            for (" + modelName + "Model model : modelList) {\n");

                                        for (String item:
                                                value) {
                                            functionSb.append("                model.set" + HzhrStringUtils.firstCharToUppserCase(item) + "(null);\n");
                                        }
                                        functionSb.append("            }\n");
                                        functionSb.append("        }\n");
                                    }

                                    functionSb.append("\n");
                                    functionSb.append("        " + getModelSimpleName + " result = new " + getModelSimpleName + "();\n");
                                    if (hasModel) {
                                        functionSb.append("        if (\"one\".equals(_show)) {\n");
                                        functionSb.append("            if (modelList.size() > 0) {\n");
                                        functionSb.append("                result.setModel(modelList.get(0));\n");
                                        functionSb.append("            }\n");
                                        functionSb.append("         }\n");
                                    }
                                    if (hasModelList) {
                                        functionSb.append("        if (\"list\".equals(_show)) {\n");
                                        functionSb.append("            result.setModelList(modelList);\n");
                                        functionSb.append("        }\n");
                                    }
                                    if (hasTotal) {
                                        functionSb.append("        result.setTotal(total);\n");
                                    }
                                    if (hasChangeCount) {
                                        functionSb.append("        result.setChangeCount(changeCount);\n");
                                    }
                                    functionSb.append("        return result;\n");
                                    functionSb.append("    }\n");
                                }


                                functionSb.append("    public " + getModelSimpleName + " extList2" + modelNameFl + "GetModel(List<" + resourceName + "EntityExt> extList, Integer total, Integer changeCount, Map<String, Object> query) {\n");
                                functionSb.append("        List<" + modelName + "Model> modelList = extList2" + modelNameFl + "ModelList(extList);\n");
                                functionSb.append("        if (modelList == null) {\n");
                                functionSb.append("            " + modelName + "GetModel result = new " + modelName + "GetModel();\n");
                                if (hasTotal) {
                                    functionSb.append("            result.setTotal(total);\n");
                                }
                                if (hasChangeCount) {
                                    functionSb.append("            result.setChangeCount(changeCount);\n");
                                }
                                functionSb.append("            return result;\n");
                                functionSb.append("        }\n");
                                functionSb.append("\n");

                                functionSb.append("         String _show = HzhrTypeUtil.object2string(query.get(\"_show\"));\n");
                                Map<String, List<String>> showMap = new HashMap<>();
                                for (Field field:
                                        modelClass1.getDeclaredFields()) {
                                    String fieldName = field.getName();
                                    if (field.getType().getSimpleName().equals("Boolean") && fieldName.startsWith("is")) {
                                        fieldName = fieldName.substring(2);
                                    }
                                    CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                                    if (cygProperty != null) {
                                        String show = cygProperty.show();

                                        if (!StringUtils.isEmpty(show)) {
                                            if (showMap.get(show) != null) {
                                                List<String> list = showMap.get(show);
                                                if (!StringUtils.isEmpty(fieldName)) {
                                                    list.add(fieldName);
                                                }
                                            } else {
                                                List<String> list = new ArrayList<>();
                                                showMap.put(show, list);
                                                if (!StringUtils.isEmpty(fieldName)) {
                                                    list.add(fieldName);
                                                }
                                            }
                                        }
                                    }
                                }

                                for (Map.Entry<String, List<String>> entry :
                                        showMap.entrySet()) {
                                    String key = entry.getKey();
                                    functionSb.append("         Boolean " + key + " = query.get(\"" + key + "\") != null ? Boolean.parseBoolean(query.get(\"" + key + "\").toString()) : false;\n");
                                }

                                functionSb.append("\n");

                                for (Map.Entry<String, List<String>> entry :
                                        showMap.entrySet()) {
                                    String key = entry.getKey();
                                    List<String> value = entry.getValue();
                                    functionSb.append("        if (!" + key + ") {\n");
                                    functionSb.append("            for (" + modelName + "Model model : modelList) {\n");

                                    for (String item:
                                            value) {
                                        functionSb.append("                model.set" + HzhrStringUtils.firstCharToUppserCase(item) + "(null);\n");
                                    }
                                    functionSb.append("            }\n");
                                    functionSb.append("        }\n");
                                }

                                functionSb.append("\n");
                                functionSb.append("        " + getModelSimpleName + " result = new " + getModelSimpleName + "();\n");
                                if (hasModel) {
                                    functionSb.append("        if (\"one\".equals(_show)) {\n");
                                    functionSb.append("            if (modelList.size() > 0) {\n");
                                    functionSb.append("                result.setModel(modelList.get(0));\n");
                                    functionSb.append("            }\n");
                                    functionSb.append("         }\n");
                                }
                                if (hasModelList) {
                                    functionSb.append("        if (\"list\".equals(_show)) {\n");
                                    functionSb.append("            result.setModelList(modelList);\n");
                                    functionSb.append("        }\n");
                                }
                                if (hasTotal) {
                                    functionSb.append("        result.setTotal(total);\n");
                                }
                                if (hasChangeCount) {
                                    functionSb.append("        result.setChangeCount(changeCount);\n");
                                }
                                functionSb.append("        return result;\n");
                                functionSb.append("    }\n");

                                functionSb.append("    public " + getModelSimpleName + " entity2" + modelNameFl + "GetModel(" + resourceName + "Entity entity, Integer total, Integer changeCount, Map<String, Object> query) {\n");
                                functionSb.append("        List<" + resourceName + "EntityExt> extList = new ArrayList<>();\n");
                                functionSb.append("        if (entity == null) return extList2" + modelNameFl + "GetModel(extList, total, changeCount, query);\n");
                                functionSb.append("        extList.add(HzhrJsonUtil.convertObjectType(entity, " + resourceName + "EntityExt.class));\n");
                                functionSb.append("        return extList2" + modelNameFl + "GetModel(extList, total, changeCount, query);\n");
                                functionSb.append("     }\n");
                            }
                        }
                    }
                }


                String modelName = resourceName + "Model";
                String model = modelName.substring(0, modelName.lastIndexOf("Model"));
                Class<?> customQueryModelClass = null;
                try {
                    customQueryModelClass = Class.forName(rootPackageName + ".queryModel.custom." + model + "CustomQueryModel");
                } catch (Exception e) {

                }
                if (customQueryModelClass != null) {
                    importSb.append("import " + customQueryModelClass.getName() + ";\n");

                    List<File> serviceFiles = HzhrFileUtil.getFiles(srcRootPath + "\\service");
                    for (File serviceFile :
                    serviceFiles) {
                        String serviceFileName = serviceFile.getName();
                        if (serviceFileName.endsWith("Service.java") && !"BaseService.java".equals(serviceFileName)) {
                            String serviceName = serviceFileName.substring(0, serviceFileName.lastIndexOf(".java"));
                            Class<?> serviceClass = null;
                            try {
                                serviceClass = Class.forName(rootPackageName + ".service." + serviceName);
                            } catch (Exception e) {

                            }
                            if (serviceClass != null) {
                                CygService cygService = serviceClass.getAnnotation(CygService.class);
                                if (cygService != null) {
                                    Class<?> entityClass1 = cygService.entity();
                                    Class<?> modelClass1 = cygService.model();
                                    if (entityClass1 != null) {
                                        if (entityClass1.getName().equals(entityClass.getName())){
                                            functionSb.append("    public " + model + "CustomQueryModel " + HzhrStringUtils.firstCharToLowerCase(serviceName) + "_query2queryModel(Map<String, Object> query) {\n");
                                            functionSb.append("        " + model + "CustomQueryModel queryModel = new " + model + "CustomQueryModel();\n");
                                            functionSb.append("\n");

                                            CygQuerys cygQuerys = serviceClass.getAnnotation(CygQuerys.class);
                                            if (cygQuerys != null) {
                                                CygQuery[] cygQueries = cygQuerys.value();
                                                for (CygQuery cygQuery : cygQueries) {
                                                    String name = cygQuery.name();
                                                    String query = cygQuery.query();
                                                    Class<?> type = cygQuery.type();

                                                    functionSb.append("        " + type.getSimpleName() + " " + name + " = HzhrTypeUtil.object2" + HzhrStringUtils.firstCharToLowerCase(type.getSimpleName()) + "(query.get(\"" + name + "\"));\n");
                                                    functionSb.append("        if (" + name + " != null) {\n");
                                                    functionSb.append("            queryModel.set" + HzhrStringUtils.firstCharToUppserCase(query) + "(" + name + ");\n");
                                                    functionSb.append("         }\n");
                                                    functionSb.append("\n");
                                                }
                                            }


                                            Map<String, List<String>> showMap = new HashMap<>();
                                            if (modelClass1 != null) {
                                                if (!Void.class.equals(modelClass1)) {
                                                    for (Field field:
                                                            modelClass1.getDeclaredFields()) {
                                                        CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                                                        if (cygProperty != null) {
                                                            String show = cygProperty.show();
                                                            String entityProp = cygProperty.entityProp();

                                                            if (!StringUtils.isEmpty(show)) {
                                                                if (showMap.get(show) != null) {
                                                                    List<String> list = showMap.get(show);
                                                                    if (!StringUtils.isEmpty(entityProp)) {
                                                                        list.add(entityProp);
                                                                    }
                                                                } else {
                                                                    List<String> list = new ArrayList<>();
                                                                    showMap.put(show, list);
                                                                    if (!StringUtils.isEmpty(entityProp)) {
                                                                        list.add(entityProp);
                                                                    }
                                                                }
                                                            } else {
                                                                if (showMap.get("show") != null) {
                                                                    List<String> list = showMap.get("show");
                                                                    if (!StringUtils.isEmpty(entityProp)) {
                                                                        list.add(entityProp);
                                                                    }
                                                                } else {
                                                                    List<String> list = new ArrayList<>();
                                                                    showMap.put("show", list);
                                                                    if (!StringUtils.isEmpty(entityProp)) {
                                                                        list.add(entityProp);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                } else {
                                                    for (Field field:
                                                            modelClass.getDeclaredFields()) {
                                                        CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                                                        if (cygProperty != null) {
                                                            String show = cygProperty.show();
                                                            String entityProp = cygProperty.entityProp();

                                                            if (!StringUtils.isEmpty(show)) {
                                                                if (showMap.get(show) != null) {
                                                                    List<String> list = showMap.get(show);
                                                                    if (!StringUtils.isEmpty(entityProp)) {
                                                                        list.add(entityProp);
                                                                    }
                                                                } else {
                                                                    List<String> list = new ArrayList<>();
                                                                    showMap.put(show, list);
                                                                    if (!StringUtils.isEmpty(entityProp)) {
                                                                        list.add(entityProp);
                                                                    }
                                                                }
                                                            } else {
                                                                if (showMap.get("show") != null) {
                                                                    List<String> list = showMap.get("show");
                                                                    if (!StringUtils.isEmpty(entityProp)) {
                                                                        list.add(entityProp);
                                                                    }
                                                                } else {
                                                                    List<String> list = new ArrayList<>();
                                                                    showMap.put("show", list);
                                                                    if (!StringUtils.isEmpty(entityProp)) {
                                                                        list.add(entityProp);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            for (Map.Entry<String, List<String>> entry :
                                                    showMap.entrySet()) {
                                                String key = entry.getKey();
                                                List<String> value = entry.getValue();

                                                if (key.equals("show")) {
                                                    for (String valueItem :
                                                            value) {
                                                        String[] split = valueItem.split("_");
                                                        if (split.length == 1) {
                                                            if (!"id".equals(split[0])) {
                                                                functionSb.append("        queryModel.setShow(true);\n");
                                                            }
                                                        } else {
                                                            List<CommonMapperGenerator.GeneratorModel1> list = CommonMapperGenerator.generatorModels_2;
                                                            for (CommonMapperGenerator.GeneratorModel1 generatorModel1 :
                                                                    list) {
                                                                if (generatorModel1.getMainEntityClass().getSimpleName().equals(model + "Entity")) {
                                                                    List<String> propNames = new ArrayList<>();
                                                                    for (int i = 0; i < split.length - 1; i++) {
                                                                        propNames.add(split[i]);
                                                                    }
                                                                    Integer ser = CommonMapperGenerator.getSer(generatorModel1, propNames, 0);
                                                                    if (ser != 0) {
                                                                        String extDes = "";
                                                                        for (String propName :
                                                                                propNames) {
                                                                            extDes += "_" + propName;
                                                                        }
                                                                        functionSb.append("        queryModel.setExt" + extDes + "(true);\n");
                                                                        functionSb.append("        queryModel.setShow" + ser + "(true);\n");
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                } else {
                                                    functionSb.append("        Boolean " + key + " = HzhrTypeUtil.object2boolean(query.get(\"" + key + "\"));\n");
                                                    functionSb.append("        if (" + key + " != null && " + key + ") {\n");
                                                    if (value.size() == 0) {
                                                        functionSb.append("            queryModel.setShow(true);\n");
                                                    } else {
                                                        for (String valueItem :
                                                                value) {
                                                            while (true) {
                                                                if (valueItem.contains("[") &&  valueItem.contains("]")) {
                                                                    valueItem = valueItem.substring(0, valueItem.indexOf('[')) + valueItem.substring(valueItem.indexOf(']') + 1);
                                                                } else {
                                                                    break;
                                                                }
                                                            }
                                                            String[] split = valueItem.split("_");
                                                            if (split.length == 1) {
                                                                functionSb.append("            queryModel.setShow(true);\n");
                                                            } else {
                                                                List<CommonMapperGenerator.GeneratorModel1> list = CommonMapperGenerator.generatorModels_2;
                                                                for (CommonMapperGenerator.GeneratorModel1 generatorModel1 :
                                                                        list) {
                                                                    if (generatorModel1.getMainEntityClass().getSimpleName().equals(model + "Entity")) {
                                                                        List<String> propNames = new ArrayList<>();
                                                                        for (int i = 0; i < split.length - 1; i++) {
                                                                            propNames.add(split[i]);
                                                                        }
                                                                        Integer ser = CommonMapperGenerator.getSer(generatorModel1, propNames, 0);
                                                                        if (ser != 0) {
                                                                            String extDes = "";
                                                                            for (String propName :
                                                                                    propNames) {
                                                                                extDes += "_" + propName;
                                                                            }
                                                                            functionSb.append("            queryModel.setExt" + extDes + "(true);\n");
                                                                            functionSb.append("            queryModel.setShow" + ser + "(true);\n");
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    functionSb.append("        }\n");
                                                }
                                            }
                                            functionSb.append("\n");
                                            functionSb.append("        Integer page = HzhrTypeUtil.object2integer(query.get(\"_page\"));\n");
                                            functionSb.append("        Integer count = HzhrTypeUtil.object2integer(query.get(\"_count\"));\n");
                                            functionSb.append("        queryModel.setPage(page, count);\n");
                                            functionSb.append("\n");
                                            functionSb.append("        return queryModel;\n");
                                            functionSb.append("    }\n");
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                functionSb.append("\n");

                importSb.append("\n");
                importSb.append("@Component\n");
                importSb.append("public class " + resourceName + "Convertor {\n");
                String content = importSb.toString() + autowireSb + "\n" + functionSb + "}\n";
                HzhrFileUtil.writeContent(srcRootPath + "\\convertor\\" + resourceName + "Convertor.java", content);


                //生成CustomConvertor
                String content1 = "package " + rootPackageName + ".convertor.custom;\n";
                content1 += "\n";
                content1 += "import " + rootPackageName + ".convertor." + resourceName + "Convertor;\n";
                content1 += "import org.springframework.stereotype.Service;\n";
                content1 += "\n";
                content1 += "@Service\n";
                content1 += "public class " + resourceName + "CustomConvertor extends " + resourceName + "Convertor {\n";
                content1 += "}\n";
                File file1 = new File(srcRootPath + "\\convertor\\custom\\" + resourceName + "CustomConvertor.java");
                if (!file1.exists()) {
                    HzhrFileUtil.writeContent(srcRootPath + "\\convertor\\custom\\" + resourceName + "CustomConvertor.java", content1);
                }
            }
        }
    }

    public static String generate3(Class classa, Class classb, String resourceName, String convertUtilName) {
        String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);
        String classbSimpleName = classb.getSimpleName();
        String classaSimpleName = classa.getSimpleName();

        String zhushi = "        //未转换字段: ";
        String content = "";

        content += "        if (in == null) return null;\n";
        content += "        " + classbSimpleName + " result = new " + classbSimpleName + "();\n";
        content += "\n";

        Field[] classaFieldsA = classa.getDeclaredFields();
        Field[] classaFieldsB = classa.getSuperclass().getDeclaredFields();
        List<Field> classaFields = new ArrayList<>();
        for (Field field:classaFieldsA) {
            classaFields.add(field);
        }
        for (Field field:classaFieldsB) {
            classaFields.add(field);
        }
        Field[] classbFieldsA = classb.getDeclaredFields();
        Field[] classbFieldsB = classb.getSuperclass().getDeclaredFields();
        List<Field> classbFields = new ArrayList<>();
        for (Field field:classbFieldsA) {
            classbFields.add(field);
        }
        for (Field field:classbFieldsB) {
            classbFields.add(field);
        }

        Set<String> convertSet = new HashSet<>();
        Set<String> noConvertSet = new HashSet<>();
        for (Field field : classaFields) {
            if (checkType(field)) {
                String fieldName = field.getName();
                String fieldType = field.getType().getSimpleName();
                String fieldTypeF = null;
                if (fieldType.equals("List")) {
                    fieldTypeF = ((Class)(((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                }

                for ( Field field1:classbFields ) {
                    boolean flag = false;
                    String fieldName1 = field1.getName();
                    String fieldType1 = field1.getType().getSimpleName();
                    String fieldTypeF1 = null;
                    if (fieldType1.equals("List")) {
                        fieldTypeF1 = ((Class) (((ParameterizedType) field1.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                    }

                    if (fieldName.equals(fieldName1)) {
                        if (fieldType1.equals("String")) {
                            if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Object")) {
                            content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2object(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            flag = true;
                        } else if (fieldType1.equals("Integer")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Integer")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integer2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Long")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Double")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Double")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".double2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Float")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Float")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".float2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Short")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Short")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".short2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("BigDecimal")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("BigDecimal")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimal2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Date")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Boolean")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Boolean")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".boolean2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.endsWith("Dto")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("Dto"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "       result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName)  + "(ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        } else if (fieldType1.endsWith("EntityExt")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("EntityExt"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        }

                        if (fieldType1.equals("List")) {
                            if (fieldTypeF1.equals("String")) {
                                if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2objectList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldTypeF1.equals("Integer")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Integer")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integeList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "());\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Long")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Double")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Double")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".doubleList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Float")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Float")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".floatList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Short")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Short")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".shortList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("BigDecimal")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("BigDecimal")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimalList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Date")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Boolean")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Boolean")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".booleanList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.endsWith("Dto")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("Dto"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            } else if (fieldTypeF1.endsWith("EntityExt")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("EntityExt"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            }
                        }
                    }
                    if (flag) {
                        convertSet.add(fieldName1);
                    }
                }
            }
        }

//        zhushi += "\n";
//        content += "\n";
        content += "        return result;\n";
//        content += "}\n";
//        content += "public static List<" + classbSimpleName + "> " + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "List2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "List(List<" + classaSimpleName + "> in) {\n";
//        content += "    if (in == null) return null;\n";
//        content += "    List<" + classbSimpleName + "> result = new ArrayList<>();\n";
//        content += "    for (" + classaSimpleName + " item : in) {\n";
//        content += "         result.add(" + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "(item));\n";
//        content += "    }\n";
//        content += "    return result;\n";
//        content += "}";
        //System.out.println(zhushi + "\n" + content);
        for (Field field : classbFields) {
            String fieldName = field.getName();
            if (!convertSet.contains(fieldName)) {
                noConvertSet.add(fieldName);
            }
        }
        for (String noConvert : noConvertSet) {
            zhushi += noConvert + " ";
        }
        return zhushi + "\n" + content;
    }
    public static String generate1(Class classa, Class classb, String resourceName, String convertUtilName) {
        String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);
        String classbSimpleName = classb.getSimpleName();
        String classaSimpleName = classa.getSimpleName();

        String zhushi = "        //未转换字段: ";
        String content = "        if (result == null) return;\n";

        Field[] classaFieldsA = classa.getDeclaredFields();
        Field[] classaFieldsB = classa.getSuperclass().getDeclaredFields();
        List<Field> classaFields = new ArrayList<>();
        for (Field field:classaFieldsA) {
            classaFields.add(field);
        }
        for (Field field:classaFieldsB) {
            classaFields.add(field);
        }
        Field[] classbFieldsA = classb.getDeclaredFields();
        Field[] classbFieldsB = classb.getSuperclass().getDeclaredFields();
        List<Field> classbFields = new ArrayList<>();
        for (Field field:classbFieldsA) {
            classbFields.add(field);
        }
        for (Field field:classbFieldsB) {
            classbFields.add(field);
        }

        Set<String> convertSet = new HashSet<>();
        Set<String> noConvertSet = new HashSet<>();
        for (Field field:classaFields) {
            if (checkType(field)) {
                String fieldName = field.getName();
                String fieldType = field.getType().getSimpleName();
                String fieldTypeF = null;
                if (fieldType.equals("List")) {
                    fieldTypeF = ((Class)(((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                }

                for ( Field field1:classbFields ) {
                    boolean flag = false;
                    String fieldName1 = field1.getName();
                    String fieldType1 = field1.getType().getSimpleName();
                    String fieldTypeF1 = null;
                    if (fieldType1.equals("List")) {
                        fieldTypeF1 = ((Class) (((ParameterizedType) field1.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                    }

                    if (fieldName.equals(fieldName1)) {
                        if (fieldType1.equals("String")) {
                            if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Object")) {
                            content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2object(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            flag = true;
                        } else if (fieldType1.equals("Integer")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Integer")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integer2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Long")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Double")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Double")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".double2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Float")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Float")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".float2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Short")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Short")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".short2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("BigDecimal")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("BigDecimal")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimal2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Date")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Boolean")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Boolean")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".boolean2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.endsWith("Dto")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("Dto"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "       result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName)  + "(ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        } else if (fieldType1.endsWith("EntityExt")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("EntityExt"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        }



                        if (fieldType1.equals("List")) {
                            if (fieldTypeF1.equals("String")) {
                                if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2objectList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldTypeF1.equals("Integer")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Integer")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integeList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "());\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Long")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Double")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Double")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".doubleList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Float")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Float")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".floatList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Short")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Short")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".shortList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("BigDecimal")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("BigDecimal")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimalList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Date")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Boolean")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Boolean")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".booleanList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.endsWith("Dto")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("Dto"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            } else if (fieldTypeF1.endsWith("EntityExt")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("EntityExt"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            }
                        }
                    }
                    if (flag) {
                        convertSet.add(fieldName1);
                    }
                }
            }
        }

//        zhushi += "\n";
//        content += "\n";
//        content += "}\n";
//        content += "public static List<" + classbSimpleName + "> " + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "List2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "List(List<" + classaSimpleName + "> in) {\n";
//        content += "    if (in == null) return null;\n";
//        content += "    List<" + classbSimpleName + "> result = new ArrayList<>();\n";
//        content += "    for (" + classaSimpleName + " item : in) {\n";
//        content += "         result.add(" + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "(item));\n";
//        content += "    }\n";
//        content += "    return result;\n";
//        content += "}";
        //System.out.println(zhushi + "\n" + content);
        for (Field field : classbFields) {
            String fieldName = field.getName();
            if (!convertSet.contains(fieldName)) {
                noConvertSet.add(fieldName);
            }
        }
        for (String noConvert : noConvertSet) {
            zhushi += noConvert + " ";
        }
        return zhushi + "\n" + content;
    }
    public static String generate2(Class classa, Class classb, String resourceName, String convertUtilName) {
        String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);
        String classbSimpleName = classb.getSimpleName();
        String classaSimpleName = classa.getSimpleName();

        String zhushi = "        //未转换字段: ";
        String content = "        if (result == null) return;\n";

        Field[] classaFieldsA = classa.getDeclaredFields();
        Field[] classaFieldsB = classa.getSuperclass().getDeclaredFields();
        List<Field> classaFields = new ArrayList<>();
        for (Field field:classaFieldsA) {
            classaFields.add(field);
        }
        for (Field field:classaFieldsB) {
            classaFields.add(field);
        }
        Field[] classbFieldsA = classb.getDeclaredFields();
        Field[] classbFieldsB = classb.getSuperclass().getDeclaredFields();
        List<Field> classbFields = new ArrayList<>();
        for (Field field:classbFieldsA) {
            classbFields.add(field);
        }
        for (Field field:classbFieldsB) {
            classbFields.add(field);
        }

        Set<String> convertSet = new HashSet<>();
        Set<String> noConvertSet = new HashSet<>();
        for (Field field:classaFields) {
            if (checkType(field)) {
                String fieldName = field.getName();
                String fieldType = field.getType().getSimpleName();
                String fieldTypeF = null;
                if (fieldType.equals("List")) {
                    fieldTypeF = ((Class)(((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                }

                for ( Field field1:classbFields ) {
                    boolean flag = false;
                    String fieldName1 = field1.getName();
                    String fieldType1 = field1.getType().getSimpleName();
                    String fieldTypeF1 = null;
                    if (fieldType1.equals("List")) {
                        fieldTypeF1 = ((Class) (((ParameterizedType) field1.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                    }

                    if (fieldName.equals(fieldName1)) {
                        content += "        if (in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "() != null) {\n";
                        if (fieldType1.equals("String")) {
                            if (fieldType.equals("Date")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Object")) {
                            content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2object(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            flag = true;
                        } else if (fieldType1.equals("Integer")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Integer")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integer2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Long")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Double")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Double")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".double2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Float")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Float")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".float2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Short")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Short")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".short2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("BigDecimal")) {
                            if (fieldType.equals("String")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("BigDecimal")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimal2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Date")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Boolean")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Boolean")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".boolean2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.endsWith("Dto")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("Dto"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "           result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName)  + "(ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        } else if (fieldType1.endsWith("EntityExt")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("EntityExt"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        }



                        if (fieldType1.equals("List")) {
                            if (fieldTypeF1.equals("String")) {
                                if (fieldTypeF.equals("Date")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Object")) {
                                content += "                result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2objectList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldTypeF1.equals("Integer")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Integer")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".integeList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "());\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Long")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Double")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Double")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".doubleList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Float")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Float")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".floatList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Short")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Short")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".shortList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("BigDecimal")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("BigDecimal")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".bigdecimalList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Date")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Boolean")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Boolean")) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".booleanList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.endsWith("Dto")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("Dto"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            } else if (fieldTypeF1.endsWith("EntityExt")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("EntityExt"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            }
                        }
                        content += "        }\n";
                    }
                    if (flag) {
                        convertSet.add(fieldName1);
                    }
                }
            }
        }

//        zhushi += "\n";
//        content += "\n";
//        content += "}\n";
//        content += "public static List<" + classbSimpleName + "> " + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "List2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "List(List<" + classaSimpleName + "> in) {\n";
//        content += "    if (in == null) return null;\n";
//        content += "    List<" + classbSimpleName + "> result = new ArrayList<>();\n";
//        content += "    for (" + classaSimpleName + " item : in) {\n";
//        content += "         result.add(" + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "(item));\n";
//        content += "    }\n";
//        content += "    return result;\n";
//        content += "}";
        //System.out.println(zhushi + "\n" + content);

        for (Field field : classbFields) {
            String fieldName = field.getName();
            if (!convertSet.contains(fieldName)) {
                noConvertSet.add(fieldName);
            }
        }
        for (String noConvert : noConvertSet) {
            zhushi += noConvert + " ";
        }
        return zhushi + "\n" + content;
    }
    public static String generate(Class classa, Class classb, String resourceName, String convertUtilName) {
        String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);
        String classbSimpleName = classb.getSimpleName();
        String classaSimpleName = classa.getSimpleName();

        String zhushi = "        //未转换字段: ";
        String content = "";

        content += "        if (in == null) return null;\n";
        content += "        " + classbSimpleName + " result = new " + classbSimpleName + "();\n";
        content += "\n";

        Field[] classaFieldsA = classa.getDeclaredFields();
        Field[] classaFieldsB = classa.getSuperclass().getDeclaredFields();
        List<Field> classaFields = new ArrayList<>();
        for (Field field:classaFieldsA) {
            classaFields.add(field);
        }
        for (Field field:classaFieldsB) {
            classaFields.add(field);
        }
        Field[] classbFieldsA = classb.getDeclaredFields();
        Field[] classbFieldsB = classb.getSuperclass().getDeclaredFields();
        List<Field> classbFields = new ArrayList<>();
        for (Field field:classbFieldsA) {
            classbFields.add(field);
        }
        for (Field field:classbFieldsB) {
            classbFields.add(field);
        }

        Set<String> convertSet = new HashSet<>();
        Set<String> noConvertSet = new HashSet<>();
        for (Field field : classaFields) {
            if (checkType(field)) {
                String fieldName = field.getName();
                String entityFieldName = null;
                CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                if (cygProperty != null) {
                    entityFieldName = cygProperty.entityProp();
                } else {
                    entityFieldName = fieldName;
                }
                String fieldType = field.getType().getSimpleName();
                String fieldTypeF = null;
                if (fieldType.equals("List")) {
                    fieldTypeF = ((Class)(((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                }

                for ( Field field1:classbFields ) {
                    boolean flag = false;
                    String fieldName1 = field1.getName();
                    String fieldType1 = field1.getType().getSimpleName();
                    String entityFieldName1 = null;
                    CygProperty cygProperty1 = field1.getAnnotation(CygProperty.class);
                    if (cygProperty1 != null) {
                        entityFieldName1 = cygProperty1.entityProp();
                    } else {
                        entityFieldName1 = fieldName1;
                    }
                    String fieldTypeF1 = null;
                    if (fieldType1.equals("List")) {
                        fieldTypeF1 = ((Class) (((ParameterizedType) field1.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                    }

                    if (entityFieldName.equals(entityFieldName1)) {
                        if (fieldType1.equals("String")) {
                            if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".date2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Object")) {
                            content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2object(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            flag = true;
                        } else if (fieldType1.equals("Integer")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Integer")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".integer2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Long")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".long2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".date2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Double")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Double")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".double2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Float")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Float")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".float2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Short")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Short")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".short2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("BigDecimal")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("BigDecimal")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".bigdecimal2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Date")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".long2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".date2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Boolean")) {
                            if (fieldName1.startsWith("is")) {
                                fieldName1 = fieldName1.substring(2);
                            }
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Boolean")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".boolean2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.endsWith("Dto")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("Dto"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "       result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1)  + "(ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        } else if (fieldType1.endsWith("EntityExt")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("EntityExt"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        }



                        if (fieldType1.equals("List")) {
                            if (fieldTypeF1.equals("String")) {
                                if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".dateList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2objectList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldTypeF1.equals("Integer")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Integer")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".integeList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "());\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Long")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".longList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".dateList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Double")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Double")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".doubleList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Float")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Float")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".floatList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Short")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Short")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".shortList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("BigDecimal")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("BigDecimal")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".bigdecimalList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Date")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".longList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".dateList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Boolean")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Boolean")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".booleanList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.endsWith("Dto")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("Dto"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            } else if (fieldTypeF1.endsWith("EntityExt")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("EntityExt"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            }
                        }
                    }
                    if (flag) {
                        convertSet.add(fieldName1);
                    }
                }
            }
        }

//        zhushi += "\n";
//        content += "\n";
        content += "        return result;\n";
//        content += "}\n";
//        content += "public static List<" + classbSimpleName + "> " + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "List2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "List(List<" + classaSimpleName + "> in) {\n";
//        content += "    if (in == null) return null;\n";
//        content += "    List<" + classbSimpleName + "> result = new ArrayList<>();\n";
//        content += "    for (" + classaSimpleName + " item : in) {\n";
//        content += "         result.add(" + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "(item));\n";
//        content += "    }\n";
//        content += "    return result;\n";
//        content += "}";
        //System.out.println(zhushi + "\n" + content);
        for (Field field : classbFields) {
            String fieldName = field.getName();
            if (!convertSet.contains(fieldName)) {
                noConvertSet.add(fieldName);
            }
        }
        for (String noConvert : noConvertSet) {
            zhushi += noConvert + " ";
        }
        return zhushi + "\n" + content;
    }
    public static String generate5(Class classa, Class classb, String resourceName, String convertUtilName) {
        String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);
        String classbSimpleName = classb.getSimpleName();
        String classaSimpleName = classa.getSimpleName();

        String zhushi = "        //未转换字段: ";
        String content = "";

        content += "        if (in == null) return null;\n";
        content += "        " + classbSimpleName + " result = ori;\n";
        content += "\n";

        Field[] classaFieldsA = classa.getDeclaredFields();
        Field[] classaFieldsB = classa.getSuperclass().getDeclaredFields();
        List<Field> classaFields = new ArrayList<>();
        for (Field field:classaFieldsA) {
            classaFields.add(field);
        }
        for (Field field:classaFieldsB) {
            classaFields.add(field);
        }
        Field[] classbFieldsA = classb.getDeclaredFields();
        Field[] classbFieldsB = classb.getSuperclass().getDeclaredFields();
        List<Field> classbFields = new ArrayList<>();
        for (Field field:classbFieldsA) {
            classbFields.add(field);
        }
        for (Field field:classbFieldsB) {
            classbFields.add(field);
        }

        Set<String> convertSet = new HashSet<>();
        Set<String> noConvertSet = new HashSet<>();
        for (Field field : classaFields) {
            if (checkType(field)) {
                String fieldName = field.getName();
                String entityFieldName = null;
                CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                if (cygProperty != null) {
                    entityFieldName = cygProperty.entityProp();
                } else {
                    entityFieldName = fieldName;
                }
                String fieldType = field.getType().getSimpleName();
                String fieldTypeF = null;
                if (fieldType.equals("List")) {
                    fieldTypeF = ((Class)(((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                }

                for ( Field field1:classbFields ) {
                    boolean flag = false;
                    String fieldName1 = field1.getName();
                    String fieldType1 = field1.getType().getSimpleName();
                    String entityFieldName1 = null;
                    CygProperty cygProperty1 = field1.getAnnotation(CygProperty.class);
                    if (cygProperty1 != null) {
                        entityFieldName1 = cygProperty1.entityProp();
                    } else {
                        entityFieldName1 = fieldName1;
                    }
                    String fieldTypeF1 = null;
                    if (fieldType1.equals("List")) {
                        fieldTypeF1 = ((Class) (((ParameterizedType) field1.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                    }

                    if (entityFieldName.equals(entityFieldName1)) {
                        if (fieldType1.equals("String")) {
                            if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".date2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Object")) {
                            content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2object(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            flag = true;
                        } else if (fieldType1.equals("Integer")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Integer")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".integer2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Long")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".long2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".date2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Double")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Double")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".double2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Float")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Float")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".float2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Short")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Short")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".short2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("BigDecimal")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("BigDecimal")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".bigdecimal2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Date")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".long2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".date2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Boolean")) {
                            if (fieldName1.startsWith("is")) {
                                fieldName1 = fieldName1.substring(2);
                            }
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Boolean")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".boolean2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.endsWith("Dto")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("Dto"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "       result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1)  + "(ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        } else if (fieldType1.endsWith("EntityExt")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("EntityExt"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        }



                        if (fieldType1.equals("List")) {
                            if (fieldTypeF1.equals("String")) {
                                if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".dateList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2objectList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldTypeF1.equals("Integer")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Integer")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".integeList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "());\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Long")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".longList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".dateList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Double")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Double")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".doubleList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Float")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Float")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".floatList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Short")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Short")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".shortList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("BigDecimal")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("BigDecimal")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".bigdecimalList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Date")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".longList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".dateList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Boolean")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Boolean")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".booleanList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.endsWith("Dto")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("Dto"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            } else if (fieldTypeF1.endsWith("EntityExt")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("EntityExt"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            }
                        }
                    }
                    if (flag) {
                        convertSet.add(fieldName1);
                    }
                }
            }
        }

//        zhushi += "\n";
//        content += "\n";
        content += "        return result;\n";
//        content += "}\n";
//        content += "public static List<" + classbSimpleName + "> " + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "List2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "List(List<" + classaSimpleName + "> in) {\n";
//        content += "    if (in == null) return null;\n";
//        content += "    List<" + classbSimpleName + "> result = new ArrayList<>();\n";
//        content += "    for (" + classaSimpleName + " item : in) {\n";
//        content += "         result.add(" + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "(item));\n";
//        content += "    }\n";
//        content += "    return result;\n";
//        content += "}";
        //System.out.println(zhushi + "\n" + content);
        for (Field field : classbFields) {
            String fieldName = field.getName();
            if (!convertSet.contains(fieldName)) {
                noConvertSet.add(fieldName);
            }
        }
        for (String noConvert : noConvertSet) {
            zhushi += noConvert + " ";
        }
        return zhushi + "\n" + content;
    }
    public static String generate4(Class classa, Class classb, String resourceName, String convertUtilName) {
        String resourceNameFl = HzhrStringUtils.firstCharToLowerCase(resourceName);
        String classbSimpleName = classb.getSimpleName();
        String classaSimpleName = classa.getSimpleName();

        String content = "";

        content += "\n";

        Field[] classaFieldsA = classa.getDeclaredFields();
        Field[] classaFieldsB = classa.getSuperclass().getDeclaredFields();
        List<Field> classaFields = new ArrayList<>();
        for (Field field:classaFieldsA) {
            classaFields.add(field);
        }
        for (Field field:classaFieldsB) {
            classaFields.add(field);
        }
        Field[] classbFieldsA = classb.getDeclaredFields();
        Field[] classbFieldsB = classb.getSuperclass().getDeclaredFields();
        List<Field> classbFields = new ArrayList<>();
        for (Field field:classbFieldsA) {
            classbFields.add(field);
        }
        for (Field field:classbFieldsB) {
            classbFields.add(field);
        }

        Set<String> convertSet = new HashSet<>();
        Set<String> noConvertSet = new HashSet<>();
        for (Field field : classaFields) {
            if (checkType(field)) {
                String fieldName = field.getName();
                String entityFieldName = null;
                CygProperty cygProperty = field.getAnnotation(CygProperty.class);
                if (cygProperty != null) {
                    entityFieldName = cygProperty.entityProp();
                } else {
                    entityFieldName = fieldName;
                }
                String fieldType = field.getType().getSimpleName();
                String fieldTypeF = null;
                if (fieldType.equals("List")) {
                    fieldTypeF = ((Class)(((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                }

                for ( Field field1:classbFields ) {
                    boolean flag = false;
                    String fieldName1 = field1.getName();
                    String fieldType1 = field1.getType().getSimpleName();
                    String entityFieldName1 = null;
                    CygProperty cygProperty1 = field1.getAnnotation(CygProperty.class);
                    if (cygProperty1 != null) {
                        entityFieldName1 = cygProperty1.entityProp();
                    } else {
                        entityFieldName1 = fieldName1;
                    }
                    String fieldTypeF1 = null;
                    if (fieldType1.equals("List")) {
                        fieldTypeF1 = ((Class) (((ParameterizedType) field1.getGenericType()).getActualTypeArguments()[0])).getSimpleName();
                    }

                    if (entityFieldName.equals(entityFieldName1)) {
                        if (fieldType1.equals("String")) {
                            if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".date2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2string(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Object")) {
                            content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2object(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            flag = true;
                        } else if (fieldType1.equals("Integer")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Integer")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".integer2integer(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Long")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".long2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".date2long(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Double")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Double")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".double2double(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Float")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Float")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".float2float(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Short")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Short")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".short2short(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("BigDecimal")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("BigDecimal")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".bigdecimal2bigdecimal(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Date")) {
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".string2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".object2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Long")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".long2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Date")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".date2date(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.equals("Boolean")) {
                            if (fieldName1.startsWith("is")) {
                                fieldName1 = fieldName1.substring(2);
                            }
                            if (fieldType.equals("String")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".string2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Object")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".object2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldType.equals("Boolean")) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".boolean2boolean(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            }
                        } else if (fieldType1.endsWith("Dto")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("Dto"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "       result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1)  + "(ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.ext2dto(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        } else if (fieldType1.endsWith("EntityExt")) {
                            String resourceName1 = fieldType1.substring(0, fieldType1.lastIndexOf("EntityExt"));
                            if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            } else {
                                content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dto2ext(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                            }
                            flag = true;
                        }



                        if (fieldType1.equals("List")) {
                            if (fieldTypeF1.equals("String")) {
                                if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".dateList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2stringList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Object")) {
                                content += "            result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2objectList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                flag = true;
                            } else if (fieldTypeF1.equals("Integer")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Integer")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".integeList2integerList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "());\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Long")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".longList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".dateList2longList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Double")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Double")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".doubleList2doubleList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Float")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Float")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".floatList2floatList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Short")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Short")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".shortList2shortList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("BigDecimal")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("BigDecimal")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".bigdecimalList2bigdecimalList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Date")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".stringList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".objectList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Long")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".longList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Date")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "(" + convertUtilName + ".dateList2dateList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.equals("Boolean")) {
                                if (fieldTypeF.equals("String")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".stringList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Object")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".objectList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                } else if (fieldTypeF.equals("Boolean")) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + convertUtilName + ".booleanList2booleanList(in.get" +  HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                    flag = true;
                                }
                            } else if (fieldTypeF1.endsWith("Dto")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("Dto"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.extList2dtoList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            } else if (fieldTypeF1.endsWith("EntityExt")) {
                                String resourceName1 = fieldTypeF1.substring(0, fieldTypeF1.lastIndexOf("EntityExt"));
                                if (HzhrStringUtils.firstCharToLowerCase(resourceName1).equals(resourceNameFl)) {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                } else {
                                    content += "        result.set" + HzhrStringUtils.firstCharToUppserCase(fieldName1) + "(" + HzhrStringUtils.firstCharToLowerCase(resourceName1) + "CustomConvertor.dtoList2extList(in.get" + HzhrStringUtils.firstCharToUppserCase(fieldName) + "()));\n";
                                }
                                flag = true;
                            }
                        }
                    }
                    if (flag) {
                        convertSet.add(fieldName1);
                    }
                }
            }
        }

//        zhushi += "\n";
//        content += "\n";
        content += "        return result;\n";
//        content += "}\n";
//        content += "public static List<" + classbSimpleName + "> " + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "List2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "List(List<" + classaSimpleName + "> in) {\n";
//        content += "    if (in == null) return null;\n";
//        content += "    List<" + classbSimpleName + "> result = new ArrayList<>();\n";
//        content += "    for (" + classaSimpleName + " item : in) {\n";
//        content += "         result.add(" + HzhrStringUtils.firstCharToLowerCase(classaSimpleName) + "2" + HzhrStringUtils.firstCharToLowerCase(classbSimpleName) + "(item));\n";
//        content += "    }\n";
//        content += "    return result;\n";
//        content += "}";
        //System.out.println(zhushi + "\n" + content);
        for (Field field : classbFields) {
            String fieldName = field.getName();
            if (!convertSet.contains(fieldName)) {
                noConvertSet.add(fieldName);
            }
        }

        return content;
    }

    /**
     * 判断field是否是java基础类型
     * @param field
     * @return
     */
    private static boolean checkType(Field field) {
//        String typeName = field.getType().getName();
//        if (typeName.startsWith("java")) {
//            return true;
//        } else {
//            return false;
//        }
        return true;
    }
}
